﻿#include <stdio.h>
char* my_strncpy(char* dest, const char* src,size_t num)
{
	char* res = dest;
	while (num--)
	{
		*dest++ = *src++;
	}
	*dest = '\0';
	return res;
}
int main()
{
	char str1[] = "Hello";
	char str2[] = "World";
	printf("%s", my_strncpy(str1, str2,4));
}